package com.cc.test;

import com.cc.dto.TreeNodeData;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 *
 * @User: c.c
 * @Date: 2022/6/28
 * @Time: 10:14
 * @Description:
 */
@Data
@AllArgsConstructor
public class UserDto implements TreeNodeData {

  private static final String ROOT_GROUP_PARENT_ID = "0";

  private String id ;
  private String parentId;
  private String name;
  private String organization;

  @Override
  public Object id() {
    return id;
  }

  @Override
  public Object parentId() {
    return parentId;
  }

  @Override
  public boolean root() {
    return parentId==null||parentId.equals(ROOT_GROUP_PARENT_ID)||parentId.isEmpty();
  }
}
